package java核心及工具类.Format类;

import java.text.FieldPosition;
import java.text.Format;
import java.text.MessageFormat.Field;
import java.util.Calendar;
import java.text.*;
/*
public class test {
	public static void main(String[] argv){
		try {
			// Creating and initializing
			// new FieldPosition Object
			//MessageFormat.Field ARGUMENT = new Field("message argument field");
			FieldPosition pos= new FieldPosition(MessageFormat.Field.ARGUMENT);
			// getting Field attribute
			// of FieldPosition object
			// using getField() mehtod
			Format.Field i = pos.getFieldAttribute();
			// display result
			System.out.println("field identifier. :- " + i);
		}catch (ClassCastException e) {
			System.out.println("Exception thrown : " + e);
		}
	}
}
*/

public class test {
    public static void main(String[] argv){
        try {
              // Creating and initializing
            // new FieldPosition Object
        	//DateFormat.Field AM_PM = new Field("am pm", Calendar.AM_PM);
            FieldPosition pos= new FieldPosition(DateFormat.Field.AM_PM);
              // getting Field attribute
            // of FieldPosition object
            // using getField() mehtod
            Format.Field i = pos.getFieldAttribute();
              // display result
            System.out.println("field identifier. :- " + i);
        } catch (ClassCastException e) {
              System.out.println("Exception thrown : " + e);
        }
    }

}
